package BinarioDecimal;

import java.util.Scanner;

public class Converte {
	
	public static void main(String[] args){
		
		
		String x = "a";
		x.charAt(0);
		
		
		
		/*Scanner sc = new Scanner(System.in);
		
		System.out.println("sadkfhqueaslkd".split("que").length);
		
		
		while (true){
			System.out.print("Digite um numero: ");
			String numero = sc.nextLine();
			
			if (numero=="sair"){
				break;
			}
			System.out.println(transforma(numero));
		}*/
		
	}
	
	public static int transforma(String num){
		int numeroDecimal = 0;
		int cont = 0;
		
		for (int i = (num.length()-1); i>=0;i--){
			numeroDecimal += Integer.parseInt(Character.toString(num.charAt(i))) * (Math.pow(2,cont));
			cont += 1;
		}
		return numeroDecimal;
		
	}

}
